package com.shenmazong.order.config;

import com.github.tobato.fastdfs.FdfsClientConfig;
import com.shenmazong.utils.FastFileUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableMBeanExport;
import org.springframework.context.annotation.Import;
import org.springframework.jmx.support.RegistrationPolicy;

/**
 * @author 军哥
 * @version 1.0
 * @description: FastDFS配置类
 * @date 2022/1/16 22:29
 */

@Configuration
@Import(FdfsClientConfig.class)
@EnableMBeanExport(registration= RegistrationPolicy.IGNORE_EXISTING)
public class DfsConfig {
    @Value("${fdfs.resHost}")
    private String resHost;

    @Value("${fdfs.storagePort}")
    private String storagePort;

    public String getResHost() {
        return resHost;
    }

    public void setResHost(String resHost) {
        this.resHost = resHost;
    }

    public String getStoragePort() {
        return storagePort;
    }

    public void setStoragePort(String storagePort) {
        this.storagePort = storagePort;
    }

    /**
     * @description 注入FastFileUtil工具类
     * @author 军哥
     * @date 2022/8/6 10:53
     * @version 1.0
     */

    @Bean
    public FastFileUtil fastFileUtil() {
        return new FastFileUtil();
    }
}
